Skip to content

BPM detector: find the BPM of an uploaded audio file; key finder title rewrite - #85

Merged
StreamSeb merged 2 commits into
mainfrom
claude/project-thread-bdqd1u
Nov 16, 2026
Merged

StreamSeb merged 2 commits into
mainfrom
claude/project-thread-bdqd1u

Conversation

@StreamSeb

Copy link
Copy Markdown
Owner

Requested by Seb · project thread

What

BPM detector reads files. /tools/bpm-detector was microphone-only. It now has a drop zone next to the Listen button: drop or pick an MP3, WAV, FLAC, AAC, OGG or M4A and the tempo is read from the decoded audio, in the browser. The result shows the BPM, the half/double-time reading, the key (linked to its Camelot page) and the file length, and the existing "Use this BPM" card works for files too. On phones the zone says "Choose an audio file".

Detection fixes (shared with the key finder):

  • Files too short to skip an intro (loops, clips) are read from the start; the minimum is now about 6 s instead of 10 s.
  • Readings under 78 BPM are doubled (the slow reading stays as the alternative). This fixed two half-tempo results in the test set below.
  • Beatless audio (near-flat autocorrelation) and non-audio files get a clear error instead of a made-up number.

Key finder snippet. /tools/key-analyzer title, meta description, OG text and tool schema are rewritten to lead with "Key Finder" and mention MP3, Camelot and BPM.

Copy. BPM detector title, meta, H1, FAQ, schema and prose now cover file analysis; the homepage, /tools and the BPM Tools menu no longer call it mic-only.

Tracking. New trackEverywhere() in src/lib/analytics.ts sends an event to both GA4 and Vercel (same pair as support_clicked). New events: bpm_file_analyzed (bpm, file_type) and bpm_file_failed (reason), plus tool_used with bpm_detector_file.

Testing

In headless Chromium against the dev server, with 16 royalty-free tracks from incompetech.com whose published BPM is known:

  • 14/16 matched the published BPM (one at 119.6 for 120). The other two: a 72 BPM downtempo track reads 144 with 72 shown as the alternative, and a 105 BPM track reads 140.
  • Each track takes about 1 to 2 s to analyse.
  • An 8 s loop works. A 3 s clip, a speech WAV, a corrupt MP3 and a JSON file each show the right error.
  • tsc is clean. pnpm lint shows the same 5 errors and 3 warnings as main, none in these files.

🤖 Generated with Claude Code

StreamSeb and others added 2 commits November 16, 2026 15:36
- The BPM detector now reads the tempo from a dropped or chosen audio file
  (MP3, WAV, FLAC, AAC, OGG, M4A), decoded in the browser, next to the
  existing microphone mode. Shows half/double-time reading and the key.
- Short files (loops, clips) are read from the start instead of returning
  nothing; readings under 78 BPM are doubled (slow reading stays as the
  alternative), which fixes half-tempo results on several house/dnb tracks.
- Beatless audio and non-audio files get a clear error.
- bpm_file_analyzed / bpm_file_failed events to GA4 and Vercel via a new
  trackEverywhere() helper.
- Key analyzer title, meta and schema rewritten around "Key Finder".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StreamSeb StreamSeb self-assigned this Nov 16, 2026
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tunetapper Ready Ready Preview Nov 16, 2026 2:37pm UTC

@StreamSeb
StreamSeb merged commit 58e64b5 into main Nov 16, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 3dbeff5b Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant